




import Login from "../pages/users/login.js"
import Reg from "../pages/users/reg.js"
import Info from "../pages/info.js"
import theaters from "./theaters.js";
import schedules from "./schedules.js";

import indent from "./indent.js";

import cinemas from "./cinemas.js";



import MoviesRouter from "./movies.js"
import List from "./list.js"
var routes = {
    '/login': () => new Login({ el: "#app" }),
    '/reg': () => new Reg({ el: "#app" }),
    '/info': {
        on() {
            // if (!UsersApi.getToken()) {
            //     location.hash = "#/login"
            // }
            new Info({ el: "#app" })

        },
        ...theaters,
        ...schedules,
        ...MoviesRouter,


        ...indent,

        ...List,

        ...cinemas,

    }

};

var router = Router(routes).configure({ recurse: 'forward' });



export default {
    init() {
        router.init();
        location.hash = location.hash || '#/login'
    }
}